通过T_sql语句向其中一次填入一条数据或一次填入多条数据的方式
3) Select 列 into 新表名 from 旧表
sName nvarchar(50) not null,
tTAge int,
select 1,90,97 union
select 6,0,100 union
select 2,90,70 union
name='TestSchool',
studentId int identity(1,1) primary key,
insert into TblScore
sAge int not null,
sEmail varchar(50),
filegrowth=10,
studentId int not null, --学生id,外键
truncate table TblStudent
select * from TblTeacher
select '杨巧巧',0,21,10000,'1991-6-6'
filename='F:\SQL Server\TestSchool_log.ldf'
insert into TblTeacher
select 4,'华佗',50,12345678901234565,'[email protected]',1,'1957-1-16' union
size=10mb,
select '刘祎',0,22,10000,'1991-11-06' union
(
select '商炳奇',1,22,10000,'1991-10-30' union
(
)
创建老师表 TblTeacher q tTId 、 tTName 、 tTGender 、 tTAge 、 tTSalary 、 tTBirthday
select 4,'曹操',22,123456789012345673,'[email protected]',1,'1985-12-6' union
select '段琳琳',0,22,10000,'1991-6-6' union
tEnglish float,
创建一个学生表 TblStudent
create database TestSchool
select '王静静',0,22,10000,'1991-6-6' union
(
select 3,59,100 union
select 1,'刘备',20,123456789012345678,'[email protected]',1,'1987-5-6' union
)
maxsize=100mb
tScoreId int identity(1,1) primary key,
tTGender bit default(1),
select 4,'甄姬',18,12345678901234565,'[email protected]',0,'1989-8-8'
select '耿宇丹',0,21,10000,'1992-12-30' union
创建学生成绩表 TblScore q tScoreId (成绩 id, 主键 , 自动编号)、 tSId (学生编号)、 tEnglish (英语成绩)、 tMath (数学成绩)
(
tTSalary money,
tTName nvarchar(50) not null,
tScoreId int not null,
)
sGender bit default(1),
(
sNo numeric(18,0),--身份证号,十八位数字,小数位0
1)Insert into 表(列) select 列 1 ,列 2 union
select 5,60,96 union
tTBirthday datetime
select 1,'关羽',19,123456789012345671,'[email protected]',1,'1988-8-6' union
create table TblStudent
select 1,'张飞',18,123456789012345672,'[email protected]',1,'1989-5-19' union
log on
tMath float
sBirthday datetime
select * from TblStudent
2)Insert into 表(列) select 列 1 ,列 2 from 表
select 4,100,80 union
复制代码 代码如下:
select '张少丹',0,22,10000,'1991-6-6' unionfilename='F:\SQL Server\TestSchool.mdf',
)
)
并使用T_sql语句向其中一次填入一条数据或一次填入多条数据的方式填入数据。
select 4,'夏侯惇',22,123456789012345674,'[email protected]',1,'1985-3-6' union
on primary
使用T_SQL创建数据库 TestSchool
select 7,80,60
select * from TblScore
name='TestSchool_log',
truncate table TblScore
insert into TblStudent
create table TblTeacher
)
tTId int identity(1,1) primary key,
(
相关热词: SQL语句
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/sql/mssql/2155.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
SQL基本教程之行转列Pivo
时间:2021-01-20
-
region from hr.Employees union
时间:2021-01-20
-
有时候需要调整用户权限
时间:2021-01-19
-
(但使用 ORDER BY 子句并不
时间:2021-01-19
-
RAND()*10000)insert into Detail
时间:2021-01-19
-
OR 运算符:在两侧的查询
时间:2021-01-19
-
放假之前老大跟我提起了
时间:2021-01-19
-
数据库的运维计策剧本篇
时间:2021-01-19
热门文章
-
4.与聚合函数和 GROUP BY 子句有关的常见错
时间:2021-01-19
-
SQL Server安全(11/11):审核(Auditing)
时间:2021-01-09
-
sqlserver中查询横表变竖表的sql语句简析
时间:2020-12-08
-
SQL Server简单模式下误删除堆表记录恢复方
时间:2020-12-12
-
关于SQL Server查询语句的使用
时间:2020-12-13
-
MSSQL教程_mssql数据库教程_MSSQL基础教程_第
时间:2020-12-13
-
jdbc连接sql server数据库问题分析
时间:2020-12-10
-
详解SQL游标的用法
时间:2020-12-27
-
sql server 关于设置null的一些建议
时间:2020-12-28
-
mssql关于一个表格结构的另外一种显示(表
时间:2020-12-11
